home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / brklyprl.lha / Emulator / Benchmarks / output / concat.pl next >
Encoding:
Text File  |  1989-04-14  |  388 b   |  17 lines

  1. %    concat (con1, con6)
  2. %    These two tests are simple examples of the concat predicate
  3. %    con1 is determinate, con6 is non-determinate getting all 6 answers
  4.  
  5. main :- concat1, !, concat6.
  6.  
  7. concat1 :- concat([a,b,c],[d,e],X),  % con1
  8.     write(X),nl.
  9. concat6 :- concat(X,Y,[a,b,c,d,e]),  % con6
  10.     write(X),nl,
  11.     write(Y),nl,nl,
  12.     fail.
  13.  
  14. concat([],L,L).
  15. concat([X|L1],L2,[X|L3]) :- concat(L1,L2,L3).
  16.  
  17.